<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<%= stylesheet_link_tag('ecac') %>
<%= stylesheet_link_tag('news') %>
<%= stylesheet_link_tag('schedule') %>
<%= stylesheet_link_tag('billing') %>
<%= stylesheet_link_tag('image') %>
<%= stylesheet_link_tag('scaffold') %>
<%= stylesheet_link_tag('forum') %>
<%= stylesheet_link_tag('profile') %>
<%= stylesheet_link_tag('calendar-blue') %>

<%=javascript_include_tag :defaults %>
<%=javascript_include_tag "schedule" %>
<%=javascript_include_tag "calendar" %>
<script type="text/javascript" src="/javascripts/calendar-en.js"></script>
<%=javascript_include_tag "calendar-setup" %>
<%=javascript_include_tag "dateFormat" %>

<title> <%= (@content_for_title || @page_title || '' ) + " - #{current_school.name}"%> </title>
</head>
<body <%= @content_for_options %> >

<div id="wrap">

<div id="header">
<div onclick="window.location='/'" id="site_title"><%=current_school.name%></div>
<div onclick="window.location='/'" style="cursor:pointer;height:80px;width:600px;"></div>
<div id="login_area">
<% if user? %>
<%= render_partial 'user/logout' %>
<% else %>
<%= render_partial 'user/login' %>
<% end %>
</div>


<div >
<ul id="nav_top">
<% if user? %>
	<li><%= render_partial('layouts/navtab',:tab_id=>:dashboard, :link =>link_to('Home', '/'))%></li>
	<li><%= render_partial('layouts/navtab',:tab_id=>:scheduling, :link =>link_to('Scheduling', :action => 'new', :controller =>'reservation'))%></li>
	<li><%= render_partial('layouts/navtab',:tab_id=>:community, :link =>link_to('Forum', :action => 'index', :controller =>'forum',:forum_name=>'general'))%></li>
	<li><%= render_partial('layouts/navtab',:tab_id=>:info, :link =>link_to('Information', '/content/about_us'))%></li>
	<% if admin? %>
		<li><%= render_partial('layouts/navtab',:tab_id=>:billing, :link =>link_to('Billing', :action => 'new_flight_record', :controller =>'billing'))%></li>
		<li><%= render_partial('layouts/navtab',:tab_id=>:admin, :link =>link_to('User Management', :action => 'users', :controller =>'admin'))%></li>
		<li><%= render_partial('layouts/navtab',:tab_id=>:cms, :link =>link_to('Content Management', :action => 'list', :controller =>'news'))%></li>
	<% end %>
<% else %>
	<li><%= render_partial('layouts/navtab', :tab_id=>:info,:link =>link_to("#{current_school.name}", '/content/index'))%></li>
<% end %>

</ul>
</div>
</div>

<div id="sub_navbar">
	<%= render_partial 'layouts/sub_navigation'%>
</div>

<div id="main">


<% if @layout_type != :single_column %>	
<table cellpadding="0px" cellspacing="0px">
<tr>
	
<td id="sidebar">

<%= @content_for_sidebar %>

</td>
<td id="content_td">
    <div class="page_title"><%= @content_for_title || @page_title %></div>
    <div id="content_two_col" class="content">   
		 <% if @suppress_flash!=true %>	
			 <% for name in [:notice, :warning, :message] %>
			   <% if flash[name] %>
			     <%= "<div id=\"#{name}\">#{flash[name]}</div>" %>
			   <% end %>
			 <% end %>
		<% end %>
	
     <%= @content_for_layout%>
       
    </div>
</td></tr>
</table>
<% else %>
<div class="page_title"><%= @content_for_title || @page_title %></div>
<div id="content" class="content">   
 <% if @suppress_flash!=true %>	
	 <% for name in [:notice, :warning, :message] %>
	   <% if flash[name] %>
	     <%= "<div id=\"#{name}\">#{flash[name]}</div>" %>
	   <% end %>
	 <% end %>
<% end %>
<%= @content_for_layout%>
</div>
<% end %>


</div>
</div>
<div style="text-align:center;font-size:9pt;padding:5px;color:#333333">Powered by <a href="http://code.google.com/p/flightschool/">FlightSchool v2.0</a></div>

<!--
<div style="position:absolute; bottom:30px; right:30px;">
  <p style="font-size:70%;">
    <a href="http://validator.w3.org/check?uri=referer">Validate HTML</a>
  </p>
 </div> 
 -->

<div id="overlay" style="display:none;position:absolute;"></div>

<%= @content_for_afterscript%>

</body>
</html>
